﻿@model IEnumerable<springProject.Models.FolderContent>
@using springProject.Extentions

@{
    ViewBag.Title = "OpenFolder";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<h1>Каталог "@ViewBag.FolderName"   </h1>
@Html.ActionLink("Создать папку", "CreateFolder", new {id = (Guid)ViewData["FolderId"]}) |
 @Html.ActionLink("Редактировать", "EditFolder", new {id = (Guid)ViewData["FolderId"]}) <br /> <br />

 <table class = "Zebra">
@foreach (var item in Model)
{   
    <tr>        
        @if (item.IsFolder)
        {
           <td>
                @Html.ActionLink(item.linkText, "OpenFolder", new { id = item.contentId })   
           </td>
           <td>
                @Html.ActionLink("Edit", "EditFolder", new { id = item.contentId })   
           </td>
           <td>
                @Html.ActionLink("Del", "DeleteFolder", new { id = item.contentId })   
           </td>
        }
        else
        {
            <td>
                 @Html.Label(item.linkText)
            </td>
            <td>
                @Html.ActionLink("Edit", "EditPageContent", new { id = item.contentId })   
           </td>
           <td>
                @Html.ActionLink("Del", "DeletePageContent", new { id = item.contentId })   
           </td>
        }                
    </tr>
}
</table>

@Html.PagingNavigator((int)ViewData["PageNumber"], (int)ViewData["PagesCount"], (int)ViewData["PageSize"], "OpenFolder", "Admin", (Guid)ViewData["FolderId"]) <br />
